import React, { Component } from 'react'

export default class index extends Component {
    constructor(props) {
        super(props);
        let completeNum = this.props.list.filter(v => {
            return v.check
        }).length;
        let allNum = this.props.list.length;
        this.state={completeNum,allNum};
        // this.setState({  })
    }
    render() {
        return (
            <div className="todo-footer">
                <label>
                    <input type="checkbox"/>
                </label>
                <span>
                    <span>已完成{this.state.completeNum}</span> / 全部{this.state.allNum}
                </span>
                <button className="btn btn-danger">清除已完成任务</button>
            </div>
        )
    }
}
